package ar.com.coonocer.joy.mdg.templatehelpers;

import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.text.WordUtils;

public class NamingUtil {
	static public String toUpperCamelCase(String name) {
		if (name == null || name.length() == 0){
			name="NoName";
		}
		//
		String aux = WordUtils.capitalizeFully(name, new char[] { ' ', '_' });
		aux = StringUtils.remove(aux, ' ');
		aux = StringUtils.remove(aux, '_');
		return aux;
	}
	
	static public String toLowerCamelCase(String name){
		String aux = toUpperCamelCase(name);
		if (aux.length()==1){
			aux = aux.toLowerCase();
		}else{
			aux = aux.substring(0,1).toLowerCase() + aux.substring(1);
		}
		return aux;
	}

}
